<template>
  <div>
      <el-tree 
        :data="allRoleList" 
        :props="defaultProps" 
        highlight-current
        :expand-on-click-node="false"
        default-expand-all
        @node-click="handleNodeClick">
      </el-tree>
  </div>
</template>

<script>
  export default {
    props:{
      allRoleList:{
        type:Array
      }
    },
    data() {
      return {
        defaultProps: {
          children: 'children',
          label: 'label'
        }
      };
    },
    methods: {
      handleNodeClick(data) {
        this.$emit('getRole',data.RoleID)
      }
    }
  };
</script>

<style lang="scss" scoped>
/deep/ .el-tree-node.is-current > .el-tree-node__content{
  background-color: #50bfff;
}
</style>